<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../template/AdminTemplate.xhtml">

    <ui:define name="contentInsert">
        
        <h3>Edit Loyalty Point</h3>
        <br/>
        <!--*************************************Tab***********************************-->
        <p:tabView>
            
                <p:tab title="Customer Loyalty Points" id="n">  
                        <h:form id="form_editloyaltypoints1">
                                                <br/>
                                                <p:panel id="panel1" >
                                                <p:ajaxStatus style="width:16px;height:16px;">
                                                    <f:facet name="start">
                                                        <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                                                    </f:facet>
                                                    <f:facet name="complete">
                                                        <h:outputText value="" />
                                                    </f:facet>
                                                 </p:ajaxStatus>
                                                 <p:messages />
                                                Input Customer Email: <p:inputText value="#{rewardMB.customerEmail}"/>  <p:commandButton value="Search" ajax="false" />
                                                </p:panel>
                                                <br/>
                                                <br/>
                                                <p:dataTable value="#{rewardMB.searchUser()}" var="o"
                                                     styleClass="order-table-shoppingcart"
                                                     rowStyleClass="contentbox"
                                                     emptyMessage="No record found"
                                                     >
                                                        

                                                    <p:column style="width: 10px">
                                                        <f:facet name="header">Customer email</f:facet>
                                                        #{o.email}
                                                    </p:column>
                                                    
                                                    <p:column style="width: 10px">
                                                        <f:facet name="header">Old Loyalty Points</f:facet>
                                                        #{o.loyaltypoint}
                                                    </p:column>
                                                    
                                                    <p:column style="width: 40px">
                                                        <f:facet name="header">New Loyalty Points</f:facet>
                                                        <p:inputText required="true" requiredMessage="loyalty points required" value="#{rewardMB.loyaltyPoint}">
                                                        <f:validateDoubleRange minimum="0" maximum="100000000"/>
                                                        </p:inputText>                 
                                                    </p:column>
                                                    
                                                    <p:column style="width: 50px">                    
                                                        <p:commandButton value="Edit" action="#{rewardMB.setUserLoyaltyPoint()}" ajax="false"/>
                                                    </p:column>

                                                </p:dataTable>

                                        </h:form>   
                                        <br/>
                                        <br/>
                </p:tab>
            
                <!--******************************************************************-->
                
                <p:tab title="Stakeholder Loyalty Points">  
                    <h:form id="form_editloyaltypoints">
                                                <br/>
                                                <p:panel id="panel2" >
                                                
                                                 
                                                Input Stakeholder Name: <p:inputText value="#{rewardMB.stakeholder}"/>  <p:commandButton value="Search" action="OutletManager/IOTR_PurchaseRedemption.xhtml" update="a"/>
                                                </p:panel>
                                                <br/>
                                                <br/>
                                                <p:dataTable value="#{rewardMB.searchStakeholder()}" var="o"
                                                     styleClass="order-table-shoppingcart"
                                                     rowStyleClass="contentbox"
                                                     emptyMessage="No record found"
                                                     id="a">
                                                    
         
                                                    <p:column style="width: 10px">
                                                        <f:facet name="header">Stakeholder Name</f:facet>
                                                        #{o.name}
                                                    </p:column>
                                                    
                                                    <p:column style="width: 40px">
                                                        <f:facet name="header">Old Loyalty Points</f:facet>
                                                        #{o.loyaltyPoints}
                                                    </p:column>
                                                    
                                                    <p:column style="width: 40px">
                                                        <f:facet name="header">New Loyalty Points</f:facet>
                                                        <p:inputText required="true" requiredMessage="loyalty points required" value="#{rewardMB.loyaltyPoint}">
                                                        <f:validateDoubleRange minimum="0" maximum="100000000"/>
                                                        </p:inputText>     
                                                    </p:column>
                                                    
                                                    <p:column style="width: 50px">                    
                                                        <p:commandButton value="Edit" action="#{rewardMB.setStakeholderLoyaltyPoint()}" update="form_editloyaltypoints"/>
                                                    </p:column>
                                                </p:dataTable>

                                        </h:form> 
                </p:tab>
              
        </p:tabView>
        <!--*************************************End Tab***********************************--> 
    </ui:define>
</ui:composition>

